package com.tjec.project.businessWorkbench.service;

import com.tjec.project.businessWorkbench.domain.BmsBusiness;
import com.tjec.project.projectWorkbench.domain.BmsProjectBusinessDto;
import com.tjec.project.projectWorkbench.domain.BmsProjectMember;
import com.tjec.project.system.domain.BmsMdBusinessCategory;
import com.tjec.project.system.domain.vo.BmsMdBusinessCategoryVO;
import com.tjec.project.workflow.domain.BmsWorkflow;

import java.util.List;

/**
 * 业务一览Service接口
 * 
 * @author pangyongfeng
 * @date 2020-04-20
 */
public interface IBmsBusinessService 
{
    /**
     * 查询业务一览
     * 
     * @param guid 业务一览ID
     * @return 业务一览
     */
    public BmsBusiness selectBmsBusinessByGuid(String guid);

    /**
     * 查询业务一览列表
     * 
     * @param bmsBusiness 业务一览
     * @return 业务一览集合
     */
    public List<BmsBusiness> selectBmsBusinessList(BmsBusiness bmsBusiness);

    /**
     * 新增业务一览
     * 
     * @param bmsBusiness 业务一览
     * @return 结果
     */
    public int insertBmsBusiness(BmsBusiness bmsBusiness);

    /**
     * 修改业务一览
     * 
     * @param bmsBusiness 业务一览
     * @return 结果
     */
    public int updateBmsBusiness(BmsBusiness bmsBusiness);
    
    /**
     * 修改业务一览
     * 
     * @param bmsBusiness 业务一览
     * @return 结果
     */
    public int updateBmsBusinessWorkflow(BmsBusiness bmsBusiness);

    /**
     * 批量删除业务一览
     * 
     * @param guids 需要删除的业务一览ID
     * @return 结果
     */
    public int deleteBmsBusinessByGuids(String[] guids);

    /**
     * 删除业务一览信息
     * 
     * @param guid 业务一览ID
     * @return 结果
     */
    public int deleteBmsBusinessByGuid(String guid);

    /**
     * 业务迁移
     * @param bmsBusiness
     * @return
     */
    public int migrationBmsBusiness(BmsBusiness bmsBusiness);

    /**
     * 查询业务通过项目id
     *
     * @param projectId 项目ID
     * @return 结果
     */
    public List<BmsBusiness> selectBmsBusinessByProjectId(String projectId);
    
    /**
     * 查询业务一览列表-不含已有咨询报告号
     * 
     * @param bmsBusiness 业务一览
     * @return 业务一览集合
     */
    public List<BmsBusiness> selectBusinessNoReportNoList(BmsBusiness bmsBusiness);
    
    /**
     * 查询业务一览列表-不含已有咨询报告号
     * 
     * @param bmsBusiness 业务一览
     * @return 业务一览集合
     */
    public List<BmsBusiness> selectBusinessNoAgencyNoList(BmsBusiness bmsBusiness);
    
    /**
     * 查询业务一览列表-不含已有造价报告号
     * 
     * @param bmsBusiness 业务一览
     * @return 业务一览集合
     */
    public List<BmsBusiness> selectBusinessNoCostNoList(BmsBusiness bmsBusiness);

    /**
     * 查询业务清单，通过当前登录人判断是否过滤招标代理类业务
     * @param bmsBusiness
     * @return
     */
    public List<BmsBusiness> selectProjectBusinessList(BmsBusiness bmsBusiness);
    
    /**
     * 获取业务类别
     * @param projectId 项目id
     * @return
     */
    public List<BmsMdBusinessCategoryVO> selectBusinessTypes(String projectId);
   
    /**
     * 判断本项目是否包含该业务类别
     * @param projectId 项目id
     * @param businessId 业务id
     * @return
     */
    public int checkProject(String projectId,String businessId);

    /**
     * 判断本业务是否能发起流程
     * @param businessTypeId 业务类别id
     * @return
     */
    public int checkBusiness(String projectId,String businessTypeId);
    
    /**
     * 检查本项目下业务名称是否重复
     * @param bmsBusiness
     * @return
     */
    int checkBussinessNameSingle(BmsBusiness bmsBusiness);
    
    public String getReportType(String businessTypeId);

	public BmsProjectBusinessDto selectNewAndOldProjectInfo(String newProjectId,String oldProjectId,String businessId);
	
    /**
     * 获取报告类型数量
     * @param businessTypeId
     * @return
     */
    public BmsBusiness getReportTypeCounts(String businessTypeId);
    
    /**
     * 修改业务一览
     * 
     * @param bmsBusiness 业务一览
     * @return 结果
     */
    public int updateWrittenStatus(BmsBusiness bmsBusiness);
    
    public int updateMoveStatus(BmsBusiness bmsBusiness);

    /**
     * 取某个项目业务数
     *
     * @param projectId
     * @return 结果
     */
    public Integer getBusinessCount(String projectId);
    
    /**
     * 修改业务一览
     * 
     * @param bmsBusiness 业务一览
     * @return 结果
     */
    public int cancelBusiness(BmsBusiness bmsBusiness);
    
    public String checkWorkflow(BmsBusiness bmsBusiness);
    
    public void cancelInstance(String businessId);
    
    
}
